<!-- 验证码组件 -->
<template>
    <div class="vcode">
        <Vcode :show="puzzVcodeObj.isShow" @success="onSuccess" @close="onClose" sliderText="拖动滑块验证"/>
    </div>

</template>

<script>
import Vcode from "vue-puzzle-vcode";

export default {
    props:['puzzVcodeObj'],
    data() {
        return {

        }
    },
    components: {
        Vcode
    },
    methods: {
        // 用户通过了验证
        onSuccess(msg) {
            // console.log('成功');
            this.$emit('yzSuccess',true)
            this.puzzVcodeObj.isShow = false; // 通过验证后，需要手动隐藏模态框
        },
        // 用户点击遮罩层，应该关闭模态框
        onClose() {
            this.puzzVcodeObj.isShow = false;
        }
    }
}
</script>
<style scoped>
.vue-puzzle-vcode>>>.vue-auth-box_ {
    top: 50% !important;
}
</style>
